package com.info.zhiduoduo.admin.controller;

import com.info.zhiduoduo.admin.model.formbean.evaluate.QueryEvaluateTagByConditionFormBean;
import com.info.zhiduoduo.admin.model.formbean.evaluate.SaveEvaluateTagFormBean;
import com.info.zhiduoduo.admin.model.formbean.evaluate.UpdateEvaluateTagFormBean;
import com.info.zhiduoduo.admin.service.EvaluateTagService;
import com.info.zhiduoduo.common.constants.SmartResult;
import com.info.zhiduoduo.common.formbean.BaseSimpleFormBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "管理端-评价标签")
@RestController
@RequestMapping("/evaluate/tag")
public class EvaluateTagController {

	@Resource
	EvaluateTagService evaluateTagService;

	@ApiOperation("管理端新增评价标签")
	@PostMapping("/saveEvaluateTag")
	public SmartResult saveEvaluateTag(@RequestBody BaseSimpleFormBean<SaveEvaluateTagFormBean> formBean) {
		return evaluateTagService.saveEvaluateTag(formBean);
	}

	@ApiOperation("管理端修改评价标签")
	@PostMapping("/updateEvaluateTag")
	public SmartResult updateEvaluateTag(@RequestBody BaseSimpleFormBean<UpdateEvaluateTagFormBean> formBean) {
		return evaluateTagService.updateEvaluateTag(formBean);
	}

	@ApiOperation("管理端作废评价标签")
	@PostMapping("/deleteEvaluateTag")
	public SmartResult deleteEvaluateTag(@RequestBody BaseSimpleFormBean<UpdateEvaluateTagFormBean> formBean) {
		return evaluateTagService.deleteEvaluateTag(formBean);
	}

	@ApiOperation("管理端查询评价标签列表")
	@PostMapping("/queryEvaluateTagByCondition")
	public SmartResult queryEvaluateTagByCondition(@RequestBody BaseSimpleFormBean<QueryEvaluateTagByConditionFormBean> formBean) {
		return evaluateTagService.queryEvaluateTagByCondition(formBean);
	}
}
